package cn.kicsy.www.anonymous_bbs.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "auto-ban")
public class AutoBanConfig {
    
    private boolean enabled = false;
    private int maxRequestsPerMinute = 60;
    private int banDurationHours = 24;
    private String banReason = "疑似CC攻击自动封禁";
    
    public boolean isEnabled() {
        return enabled;
    }
    
    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }
    
    public int getMaxRequestsPerMinute() {
        return maxRequestsPerMinute;
    }
    
    public void setMaxRequestsPerMinute(int maxRequestsPerMinute) {
        this.maxRequestsPerMinute = maxRequestsPerMinute;
    }
    
    public int getBanDurationHours() {
        return banDurationHours;
    }
    
    public void setBanDurationHours(int banDurationHours) {
        this.banDurationHours = banDurationHours;
    }
    
    public String getBanReason() {
        return banReason;
    }
    
    public void setBanReason(String banReason) {
        this.banReason = banReason;
    }
}